home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-37 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  36.3 KB  |  1,198 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Writing XEmacs Primitives,  Next: Object Internals,  Prev: Garbage Collection,  Up: XEmacs Internals
  46.  
  47. Writing XEmacs Primitives
  48. =========================
  49.  
  50.    Lisp primitives are Lisp functions implemented in C.  The details of
  51. interfacing the C function so that Lisp can call it are handled by a few
  52. C macros.  The only way to really understand how to write new C code is
  53. to read the source, but we can explain some things here.
  54.  
  55.    An example of a special form is the definition of `or', from
  56. `eval.c'.  (An ordinary function would have the same general
  57. appearance.)
  58.  
  59.      DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
  60.        "Eval args until one of them yields non-nil, then return that value.\n\
  61.      The remaining args are not evalled at all.\n\
  62.  
  63.      If all args return nil, return nil.")
  64.        (args)
  65.           Lisp_Object args;
  66.      {
  67.        register Lisp_Object val;
  68.        Lisp_Object args_left;
  69.        struct gcpro gcpro1;
  70.  
  71.      if (NULL (args))
  72.          return Qnil;
  73.      
  74.        args_left = args;
  75.        GCPRO1 (args_left);
  76.  
  77.      do
  78.          {
  79.            val = Feval (Fcar (args_left));
  80.            if (!NULL (val))
  81.              break;
  82.            args_left = Fcdr (args_left);
  83.          }
  84.        while (!NULL (args_left));
  85.  
  86.      UNGCPRO;
  87.        return val;
  88.      }
  89.  
  90.    Let's start with a precise explanation of the arguments to the
  91. `DEFUN' macro.  Here is a template for them:
  92.  
  93.      DEFUN (LNAME, FNAME, SNAME, MIN, MAX, INTERACTIVE, DOC)
  94.  
  95. LNAME
  96.      This is the name of the Lisp symbol to define as the function
  97.      name; in the example above, it is `or'.
  98.  
  99. FNAME
  100.      This is the C function name for this function.  This is the name
  101.      that is used in C code for calling the function.  The name is, by
  102.      convention, `F' prepended to the Lisp name, with all dashes (`-')
  103.      in the Lisp name changed to underscores.  Thus, to call this
  104.      function from C code, call `For'.  Remember that the arguments must
  105.      be of type `Lisp_Object'; various macros and functions for creating
  106.      values of type `Lisp_Object' are declared in the file `lisp.h'.
  107.  
  108. SNAME
  109.      This is a C variable name to use for a structure that holds the
  110.      data for the subr object that represents the function in Lisp.
  111.      This structure conveys the Lisp symbol name to the initialization
  112.      routine that will create the symbol and store the subr object as
  113.      its definition.  By convention, this name is always FNAME with `F'
  114.      replaced with `S'.
  115.  
  116. MIN
  117.      This is the minimum number of arguments that the function
  118.      requires.  The function `or' allows a minimum of zero arguments.
  119.  
  120. MAX
  121.      This is the maximum number of arguments that the function accepts,
  122.      if there is a fixed maximum.  Alternatively, it can be `UNEVALLED',
  123.      indicating a special form that receives unevaluated arguments, or
  124.      `MANY', indicating an unlimited number of evaluated arguments (the
  125.      equivalent of `&rest').  Both `UNEVALLED' and `MANY' are macros.
  126.      If MAX is a number, it may not be less than MIN and it may not be
  127.      greater than seven.
  128.  
  129. INTERACTIVE
  130.      This is an interactive specification, a string such as might be
  131.      used as the argument of `interactive' in a Lisp function.  In the
  132.      case of `or', it is 0 (a null pointer), indicating that `or'
  133.      cannot be called interactively.  A value of `""' indicates a
  134.      function that should receive no arguments when called
  135.      interactively.
  136.  
  137. DOC
  138.      This is the documentation string.  It is written just like a
  139.      documentation string for a function defined in Lisp, except you
  140.      must write `\n\' at the end of each line.  In particular, the
  141.      first line should be a single sentence.
  142.  
  143.    After the call to the `DEFUN' macro, you must write the argument
  144. name list that every C function must have, followed by ordinary C
  145. declarations for the arguments.  For a function with a fixed maximum
  146. number of arguments, declare a C argument for each Lisp argument, and
  147. give them all type `Lisp_Object'.  When a Lisp function has no upper
  148. limit on the number of arguments, its implementation in C actually
  149. receives exactly two arguments: the first is the number of Lisp
  150. arguments, and the second is the address of a block containing their
  151. values.  They have types `int' and `Lisp_Object *'.
  152.  
  153.    Within the function `For' itself, note the use of the macros
  154. `GCPRO1' and `UNGCPRO'.  `GCPRO1' is used to "protect" a variable from
  155. garbage collection--to inform the garbage collector that it must look
  156. in that variable and regard its contents as an accessible object.  This
  157. is necessary whenever you call `Feval' or anything that can directly or
  158. indirectly call `Feval'.  At such a time, any Lisp object that you
  159. intend to refer to again must be protected somehow.  `UNGCPRO' cancels
  160. the protection of the variables that are protected in the current
  161. function.  It is necessary to do this explicitly.
  162.  
  163.    For most data types, it suffices to protect at least one pointer to
  164. the object; as long as the object is not recycled, all pointers to it
  165. remain valid.  This is not so for strings, because the garbage collector
  166. can move them.  When the garbage collector moves a string, it relocates
  167. all the pointers it knows about; any other pointers become invalid.
  168. Therefore, you must protect all pointers to strings across any point
  169. where garbage collection may be possible.
  170.  
  171.    The macro `GCPRO1' protects just one local variable.  If you want to
  172. protect two, use `GCPRO2' instead; repeating `GCPRO1' will not work.
  173. Macros `GCPRO3' and `GCPRO4' also exist.
  174.  
  175.    These macros implicitly use local variables such as `gcpro1'; you
  176. must declare these explicitly, with type `struct gcpro'.  Thus, if you
  177. use `GCPRO2', you must declare `gcpro1' and `gcpro2'.  Alas, we can't
  178. explain all the tricky details here.
  179.  
  180.    You must not use C initializers for static or global variables unless
  181. they are never written once XEmacs is dumped.  These variables with
  182. initializers are allocated in an area of memory that becomes read-only
  183. (on certain operating systems) as a result of dumping XEmacs.  *Note
  184. Pure Storage::.
  185.  
  186.    Do not use static variables within functions--place all static
  187. variables at top level in the file.  This is necessary because XEmacs on
  188. some operating systems defines the keyword `static' as a null macro.
  189. (This definition is used because those systems put all variables
  190. declared static in a place that becomes read-only after dumping, whether
  191. they have initializers or not.)
  192.  
  193.    Defining the C function is not enough to make a Lisp primitive
  194. available; you must also create the Lisp symbol for the primitive and
  195. store a suitable subr object in its function cell.  The code looks like
  196. this:
  197.  
  198.      defsubr (&SUBR-STRUCTURE-NAME);
  199.  
  200. Here SUBR-STRUCTURE-NAME is the name you used as the third argument to
  201. `DEFUN'.
  202.  
  203.    If you add a new primitive to a file that already has Lisp primitives
  204. defined in it, find the function (near the end of the file) named
  205. `syms_of_SOMETHING', and add the call to `defsubr' there.  If the file
  206. doesn't have this function, or if you create a new file, add to it a
  207. `syms_of_FILENAME' (e.g., `syms_of_myfile').  Then find the spot in
  208. `emacs.c' where all of these functions are called, and add a call to
  209. `syms_of_FILENAME' there.
  210.  
  211.    The function `syms_of_FILENAME' is also the place to define any C
  212. variables that are to be visible as Lisp variables.  `DEFVAR_LISP'
  213. makes a C variable of type `Lisp_Object' visible in Lisp.  `DEFVAR_INT'
  214. makes a C variable of type `int' visible in Lisp with a value that is
  215. always an integer.  `DEFVAR_BOOL' makes a C variable of type `int'
  216. visible in Lisp with a value that is either `t' or `nil'.
  217.  
  218.    Here is another example function, with more complicated arguments.
  219. This comes from the code for the X Window System, and it demonstrates
  220. the use of macros and functions to manipulate Lisp objects.
  221.  
  222.      DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
  223.        Scoordinates_in_window_p, 2, 2,
  224.        "xSpecify coordinate pair: \nXExpression which evals to window: ",
  225.        "Return non-nil if POSITIONS is in WINDOW.\n\
  226.        \(POSITIONS is a list, (SCREEN-X SCREEN-Y)\)\n\
  227.  
  228.      Returned value is list of positions expressed\n\
  229.        relative to window upper left corner.")
  230.        (coordinate, window)
  231.           register Lisp_Object coordinate, window;
  232.      {
  233.        register Lisp_Object xcoord, ycoord;
  234.  
  235.      if (!CONSP (coordinate)) wrong_type_argument (Qlistp, coordinate);
  236.        CHECK_WINDOW (window, 2);
  237.        xcoord = Fcar (coordinate);
  238.        ycoord = Fcar (Fcdr (coordinate));
  239.        CHECK_NUMBER (xcoord, 0);
  240.        CHECK_NUMBER (ycoord, 1);
  241.  
  242.      if ((XINT (xcoord) < XINT (XWINDOW (window)->left))
  243.            || (XINT (xcoord) >= (XINT (XWINDOW (window)->left)
  244.                                  + XINT (XWINDOW (window)->width))))
  245.          return Qnil;
  246.        XFASTINT (xcoord) -= XFASTINT (XWINDOW (window)->left);
  247.  
  248.      if (XINT (ycoord) == (frame_height - 1))
  249.          return Qnil;
  250.  
  251.      if ((XINT (ycoord) < XINT (XWINDOW (window)->top))
  252.            || (XINT (ycoord) >= (XINT (XWINDOW (window)->top)
  253.                                  + XINT (XWINDOW (window)->height)) - 1))
  254.          return Qnil;
  255.  
  256.      XFASTINT (ycoord) -= XFASTINT (XWINDOW (window)->top);
  257.        return (Fcons (xcoord, Fcons (ycoord, Qnil)));
  258.      }
  259.  
  260.    Note that C code cannot call functions by name unless they are
  261. defined in C.  The way to call a function written in Lisp is to use
  262. `Ffuncall', which embodies the Lisp function `funcall'.  Since the Lisp
  263. function `funcall' accepts an unlimited number of arguments, in C it
  264. takes two: the number of Lisp-level arguments, and a one-dimensional
  265. array containing their values.  The first Lisp-level argument is the
  266. Lisp function to call, and the rest are the arguments to pass to it.
  267. Since `Ffuncall' can call the evaluator, you must protect pointers from
  268. garbage collection around the call to `Ffuncall'.
  269.  
  270.    The C functions `call0', `call1', `call2', and so on, provide handy
  271. ways to call a Lisp function conveniently with a fixed number of
  272. arguments.  They work by calling `Ffuncall'.
  273.  
  274.    `eval.c' is a very good file to look through for examples; `lisp.h'
  275. contains the definitions for some important macros and functions.
  276.  
  277. 
  278. File: lispref.info,  Node: Object Internals,  Prev: Writing XEmacs Primitives,  Up: XEmacs Internals
  279.  
  280. Object Internals
  281. ================
  282.  
  283.    Emacs Lisp manipulates many different types of data.  The actual
  284. data are stored in a heap and the only access that programs have to it
  285. is through pointers.  Pointers are thirty-two bits wide in most
  286. implementations.  Depending on the operating system and type of machine
  287. for which you compile XEmacs, twenty-four to twenty-six bits are used to
  288. address the object, and the remaining six to eight bits are used for a
  289. tag that identifies the object's type.
  290.  
  291.    Because Lisp objects are represented as tagged pointers, it is always
  292. possible to determine the Lisp data type of any object.  The C data type
  293. `Lisp_Object' can hold any Lisp object of any data type.  Ordinary
  294. variables have type `Lisp_Object', which means they can hold any type
  295. of Lisp value; you can determine the actual data type only at run time.
  296. The same is true for function arguments; if you want a function to
  297. accept only a certain type of argument, you must check the type
  298. explicitly using a suitable predicate (*note Type Predicates::.).
  299.  
  300. * Menu:
  301.  
  302. * Buffer Internals::    Components of a buffer structure.
  303. * Window Internals::    Components of a window structure.
  304. * Process Internals::   Components of a process structure.
  305.  
  306. 
  307. File: lispref.info,  Node: Buffer Internals,  Next: Window Internals,  Prev: Object Internals,  Up: Object Internals
  308.  
  309. Buffer Internals
  310. ----------------
  311.  
  312.    Buffers contain fields not directly accessible by the Lisp
  313. programmer.  We describe them here, naming them by the names used in
  314. the C code.  Many are accessible indirectly in Lisp programs via Lisp
  315. primitives.
  316.  
  317. `name'
  318.      The buffer name is a string that names the buffer.  It is
  319.      guaranteed to be unique.  *Note Buffer Names::.
  320.  
  321. `save_modified'
  322.      This field contains the time when the buffer was last saved, as an
  323.      integer.  *Note Buffer Modification::.
  324.  
  325. `modtime'
  326.      This field contains the modification time of the visited file.  It
  327.      is set when the file is written or read.  Every time the buffer is
  328.      written to the file, this field is compared to the modification
  329.      time of the file.  *Note Buffer Modification::.
  330.  
  331. `auto_save_modified'
  332.      This field contains the time when the buffer was last auto-saved.
  333.  
  334. `last_window_start'
  335.      This field contains the `window-start' position in the buffer as of
  336.      the last time the buffer was displayed in a window.
  337.  
  338. `undo_list'
  339.      This field points to the buffer's undo list.  *Note Undo::.
  340.  
  341. `syntax_table_v'
  342.      This field contains the syntax table for the buffer.  *Note Syntax
  343.      Tables::.
  344.  
  345. `downcase_table'
  346.      This field contains the conversion table for converting text to
  347.      lower case.  *Note Case Table::.
  348.  
  349. `upcase_table'
  350.      This field contains the conversion table for converting text to
  351.      upper case.  *Note Case Table::.
  352.  
  353. `case_canon_table'
  354.      This field contains the conversion table for canonicalizing text
  355.      for case-folding search.  *Note Case Table::.
  356.  
  357. `case_eqv_table'
  358.      This field contains the equivalence table for case-folding search.
  359.      *Note Case Table::.
  360.  
  361. `display_table'
  362.      This field contains the buffer's display table, or `nil' if it
  363.      doesn't have one.  *Note Display Tables::.
  364.  
  365. `markers'
  366.      This field contains the chain of all markers that currently point
  367.      into the buffer.  Deletion of text in the buffer, and motion of
  368.      the buffer's gap, must check each of these markers and perhaps
  369.      update it.  *Note Markers::.
  370.  
  371. `backed_up'
  372.      This field is a flag that tells whether a backup file has been made
  373.      for the visited file of this buffer.
  374.  
  375. `mark'
  376.      This field contains the mark for the buffer.  The mark is a marker,
  377.      hence it is also included on the list `markers'.  *Note The Mark::.
  378.  
  379. `mark_active'
  380.      This field is non-`nil' if the buffer's mark is active.
  381.  
  382. `local_var_alist'
  383.      This field contains the association list describing the variables
  384.      local in this buffer, and their values, with the exception of
  385.      local variables that have special slots in the buffer object.
  386.      (Those slots are omitted from this table.)  *Note Buffer-Local
  387.      Variables::.
  388.  
  389. `modeline_format'
  390.      This field contains a Lisp object which controls how to display
  391.      the mode line for this buffer.  *Note Modeline Format::.
  392.  
  393. `base_buffer'
  394.      This field holds the buffer's base buffer (if it is an indirect
  395.      buffer), or `nil'.
  396.  
  397. 
  398. File: lispref.info,  Node: Window Internals,  Next: Process Internals,  Prev: Buffer Internals,  Up: Object Internals
  399.  
  400. Window Internals
  401. ----------------
  402.  
  403.    Windows have the following accessible fields:
  404.  
  405. `frame'
  406.      The frame that this window is on.
  407.  
  408. `mini_p'
  409.      Non-`nil' if this window is a minibuffer window.
  410.  
  411. `buffer'
  412.      The buffer that the window is displaying.  This may change often
  413.      during the life of the window.
  414.  
  415. `dedicated'
  416.      Non-`nil' if this window is dedicated to its buffer.
  417.  
  418. `pointm'
  419.      This is the value of point in the current buffer when this window
  420.      is selected; when it is not selected, it retains its previous
  421.      value.
  422.  
  423. `start'
  424.      The position in the buffer that is the first character to be
  425.      displayed in the window.
  426.  
  427. `force_start'
  428.      If this flag is non-`nil', it says that the window has been
  429.      scrolled explicitly by the Lisp program.  This affects what the
  430.      next redisplay does if point is off the screen: instead of
  431.      scrolling the window to show the text around point, it moves point
  432.      to a location that is on the screen.
  433.  
  434. `last_modified'
  435.      The `modified' field of the window's buffer, as of the last time a
  436.      redisplay completed in this window.
  437.  
  438. `last_point'
  439.      The buffer's value of point, as of the last time a redisplay
  440.      completed in this window.
  441.  
  442. `left'
  443.      This is the left-hand edge of the window, measured in columns.
  444.      (The leftmost column on the screen is column 0.)
  445.  
  446. `top'
  447.      This is the top edge of the window, measured in lines.  (The top
  448.      line on the screen is line 0.)
  449.  
  450. `height'
  451.      The height of the window, measured in lines.
  452.  
  453. `width'
  454.      The width of the window, measured in columns.
  455.  
  456. `next'
  457.      This is the window that is the next in the chain of siblings.  It
  458.      is `nil' in a window that is the rightmost or bottommost of a
  459.      group of siblings.
  460.  
  461. `prev'
  462.      This is the window that is the previous in the chain of siblings.
  463.      It is `nil' in a window that is the leftmost or topmost of a group
  464.      of siblings.
  465.  
  466. `parent'
  467.      Internally, XEmacs arranges windows in a tree; each group of
  468.      siblings has a parent window whose area includes all the siblings.
  469.      This field points to a window's parent.
  470.  
  471.      Parent windows do not display buffers, and play little role in
  472.      display except to shape their child windows.  Emacs Lisp programs
  473.      usually have no access to the parent windows; they operate on the
  474.      windows at the leaves of the tree, which actually display buffers.
  475.  
  476. `hscroll'
  477.      This is the number of columns that the display in the window is
  478.      scrolled horizontally to the left.  Normally, this is 0.
  479.  
  480. `use_time'
  481.      This is the last time that the window was selected.  The function
  482.      `get-lru-window' uses this field.
  483.  
  484. `display_table'
  485.      The window's display table, or `nil' if none is specified for it.
  486.  
  487. `update_mode_line'
  488.      Non-`nil' means this window's mode line needs to be updated.
  489.  
  490. `base_line_number'
  491.      The line number of a certain position in the buffer, or `nil'.
  492.      This is used for displaying the line number of point in the mode
  493.      line.
  494.  
  495. `base_line_pos'
  496.      The position in the buffer for which the line number is known, or
  497.      `nil' meaning none is known.
  498.  
  499. `region_showing'
  500.      If the region (or part of it) is highlighted in this window, this
  501.      field holds the mark position that made one end of that region.
  502.      Otherwise, this field is `nil'.
  503.  
  504. 
  505. File: lispref.info,  Node: Process Internals,  Prev: Window Internals,  Up: Object Internals
  506.  
  507. Process Internals
  508. -----------------
  509.  
  510.    The fields of a process are:
  511.  
  512. `name'
  513.      A string, the name of the process.
  514.  
  515. `command'
  516.      A list containing the command arguments that were used to start
  517.      this process.
  518.  
  519. `filter'
  520.      A function used to accept output from the process instead of a
  521.      buffer, or `nil'.
  522.  
  523. `sentinel'
  524.      A function called whenever the process receives a signal, or `nil'.
  525.  
  526. `buffer'
  527.      The associated buffer of the process.
  528.  
  529. `pid'
  530.      An integer, the Unix process ID.
  531.  
  532. `childp'
  533.      A flag, non-`nil' if this is really a child process.  It is `nil'
  534.      for a network connection.
  535.  
  536. `mark'
  537.      A marker indicating the position of the end of the last output
  538.      from this process inserted into the buffer.  This is often but not
  539.      always the end of the buffer.
  540.  
  541. `kill_without_query'
  542.      If this is non-`nil', killing XEmacs while this process is still
  543.      running does not ask for confirmation about killing the process.
  544.  
  545. `raw_status_low'
  546. `raw_status_high'
  547.      These two fields record 16 bits each of the process status
  548.      returned by the `wait' system call.
  549.  
  550. `status'
  551.      The process status, as `process-status' should return it.
  552.  
  553. `tick'
  554. `update_tick'
  555.      If these two fields are not equal, a change in the status of the
  556.      process needs to be reported, either by running the sentinel or by
  557.      inserting a message in the process buffer.
  558.  
  559. `pty_flag'
  560.      Non-`nil' if communication with the subprocess uses a PTY; `nil'
  561.      if it uses a pipe.
  562.  
  563. `infd'
  564.      The file descriptor for input from the process.
  565.  
  566. `outfd'
  567.      The file descriptor for output to the process.
  568.  
  569. `subtty'
  570.      The file descriptor for the terminal that the subprocess is using.
  571.      (On some systems, there is no need to record this, so the value is
  572.      `nil'.)
  573.  
  574. `tty_name'
  575.      The name of the terminal that the subprocess is using, or `nil' if
  576.      it is using pipes.
  577.  
  578. 
  579. File: lispref.info,  Node: Standard Errors,  Next: Standard Buffer-Local Variables,  Prev: XEmacs Internals,  Up: Top
  580.  
  581. Standard Errors
  582. ***************
  583.  
  584.    Here is the complete list of the error symbols in standard Emacs,
  585. grouped by concept.  The list includes each symbol's message (on the
  586. `error-message' property of the symbol) and a cross reference to a
  587. description of how the error can occur.
  588.  
  589.    Each error symbol has an `error-conditions' property that is a list
  590. of symbols.  Normally this list includes the error symbol itself and
  591. the symbol `error'.  Occasionally it includes additional symbols, which
  592. are intermediate classifications, narrower than `error' but broader
  593. than a single error symbol.  For example, all the errors in accessing
  594. files have the condition `file-error'.
  595.  
  596.    As a special exception, the error symbol `quit' does not have the
  597. condition `error', because quitting is not considered an error.
  598.  
  599.    *Note Errors::, for an explanation of how errors are generated and
  600. handled.
  601.  
  602. `SYMBOL'
  603.      STRING; REFERENCE.
  604.  
  605. `error'
  606.      `"error"'
  607.      *Note Errors::.
  608.  
  609. `quit'
  610.      `"Quit"'
  611.      *Note Quitting::.
  612.  
  613. `args-out-of-range'
  614.      `"Args out of range"'
  615.      *Note Sequences Arrays Vectors::.
  616.  
  617. `arith-error'
  618.      `"Arithmetic error"'
  619.      See `/' and `%' in *Note Numbers::.
  620.  
  621. `beginning-of-buffer'
  622.      `"Beginning of buffer"'
  623.      *Note Motion::.
  624.  
  625. `buffer-read-only'
  626.      `"Buffer is read-only"'
  627.      *Note Read Only Buffers::.
  628.  
  629. `cyclic-function-indirection'
  630.      `"Symbol's chain of function indirections contains a loop"'
  631.      *Note Function Indirection::.
  632.  
  633. `domain-error'
  634.      `"Arithmetic domain error"'
  635. `end-of-buffer'
  636.      `"End of buffer"'
  637.      *Note Motion::.
  638.  
  639. `end-of-file'
  640.      `"End of file during parsing"'
  641.      This is not a `file-error'.
  642.      *Note Input Functions::.
  643.  
  644. `file-error'
  645.      This error and its subcategories do not have error-strings,
  646.      because the error message is constructed from the data items alone
  647.      when the error condition `file-error' is present.
  648.      *Note Files::.
  649.  
  650. `file-locked'
  651.      This is a `file-error'.
  652.      *Note File Locks::.
  653.  
  654. `file-already-exists'
  655.      This is a `file-error'.
  656.      *Note Writing to Files::.
  657.  
  658. `file-supersession'
  659.      This is a `file-error'.
  660.      *Note Modification Time::.
  661.  
  662. `invalid-function'
  663.      `"Invalid function"'
  664.      *Note Classifying Lists::.
  665.  
  666. `invalid-read-syntax'
  667.      `"Invalid read syntax"'
  668.      *Note Input Functions::.
  669.  
  670. `invalid-regexp'
  671.      `"Invalid regexp"'
  672.      *Note Regular Expressions::.
  673.  
  674. `mark-inactive'
  675.      `"The mark is not active now"'
  676. `no-catch'
  677.      `"No catch for tag"'
  678.      *Note Catch and Throw::.
  679.  
  680. `overflow-error'
  681.      `"Arithmetic overflow error"'
  682. `protected-field'
  683.      `"Attempt to modify a protected field"'
  684. `range-error'
  685.      `"Arithmetic range error"'
  686. `search-failed'
  687.      `"Search failed"'
  688.      *Note Searching and Matching::.
  689.  
  690. `setting-constant'
  691.      `"Attempt to set a constant symbol"'
  692.      The values of the symbols `nil' and `t' may not be changed.
  693.      *Note Variables that Never Change: Constant Variables.
  694.  
  695. `singularity-error'
  696.      `"Arithmetic singularity error"'
  697. `tooltalk-error'
  698.      `"ToolTalk error"'
  699.      *Note ToolTalk Support::.
  700.  
  701. `undefined-keystroke-sequence'
  702.      `"Undefined keystroke sequence"'
  703. `underflow-error'
  704.      `"Arithmetic underflow error"'
  705. `void-function'
  706.      `"Symbol's function definition is void"'
  707.      *Note Function Cells::.
  708.  
  709. `void-variable'
  710.      `"Symbol's value as variable is void"'
  711.      *Note Accessing Variables::.
  712.  
  713. `wrong-number-of-arguments'
  714.      `"Wrong number of arguments"'
  715.      *Note Classifying Lists::.
  716.  
  717. `wrong-type-argument'
  718.      `"Wrong type argument"'
  719.      *Note Type Predicates::.
  720.  
  721.    These error types, which are all classified as special cases of
  722. `arith-error', can occur on certain systems for invalid use of
  723. mathematical functions.
  724.  
  725. `domain-error'
  726.      `"Arithmetic domain error"'
  727.      *Note Math Functions::.
  728.  
  729. `overflow-error'
  730.      `"Arithmetic overflow error"'
  731.      *Note Math Functions::.
  732.  
  733. `range-error'
  734.      `"Arithmetic range error"'
  735.      *Note Math Functions::.
  736.  
  737. `singularity-error'
  738.      `"Arithmetic singularity error"'
  739.      *Note Math Functions::.
  740.  
  741. `underflow-error'
  742.      `"Arithmetic underflow error"'
  743.      *Note Math Functions::.
  744.  
  745. 
  746. File: lispref.info,  Node: Standard Buffer-Local Variables,  Next: Standard Keymaps,  Prev: Standard Errors,  Up: Top
  747.  
  748. Buffer-Local Variables
  749. **********************
  750.  
  751.    The table below lists the general-purpose Emacs variables that are
  752. automatically local (when set) in each buffer.  Many Lisp packages
  753. define such variables for their internal use; we don't list them here.
  754.  
  755. `abbrev-mode'
  756.      *note Abbrevs::.
  757.  
  758. `auto-fill-function'
  759.      *note Auto Filling::.
  760.  
  761. `buffer-auto-save-file-name'
  762.      *note Auto-Saving::.
  763.  
  764. `buffer-backed-up'
  765.      *note Backup Files::.
  766.  
  767. `buffer-display-table'
  768.      *note Display Tables::.
  769.  
  770. `buffer-file-format'
  771.      *note Format Conversion::.
  772.  
  773. `buffer-file-name'
  774.      *note Buffer File Name::.
  775.  
  776. `buffer-file-number'
  777.      *note Buffer File Name::.
  778.  
  779. `buffer-file-truename'
  780.      *note Buffer File Name::.
  781.  
  782. `buffer-file-type'
  783.      *note Files and MS-DOS::.
  784.  
  785. `buffer-invisibility-spec'
  786.      *note Invisible Text::.
  787.  
  788. `buffer-offer-save'
  789.      *note Saving Buffers::.
  790.  
  791. `buffer-read-only'
  792.      *note Read Only Buffers::.
  793.  
  794. `buffer-saved-size'
  795.      *note Point::.
  796.  
  797. `buffer-undo-list'
  798.      *note Undo::.
  799.  
  800. `cache-long-line-scans'
  801.      *note Text Lines::.
  802.  
  803. `case-fold-search'
  804.      *note Searching and Case::.
  805.  
  806. `ctl-arrow'
  807.      *note Usual Display::.
  808.  
  809. `comment-column'
  810.      *note Comments: (emacs)Comments.
  811.  
  812. `default-directory'
  813.      *note System Environment::.
  814.  
  815. `defun-prompt-regexp'
  816.      *note List Motion::.
  817.  
  818. `fill-column'
  819.      *note Auto Filling::.
  820.  
  821. `goal-column'
  822.      *note Moving Point: (emacs)Moving Point.
  823.  
  824. `left-margin'
  825.      *note Indentation::.
  826.  
  827. `local-abbrev-table'
  828.      *note Abbrevs::.
  829.  
  830. `local-write-file-hooks'
  831.      *note Saving Buffers::.
  832.  
  833. `major-mode'
  834.      *note Mode Help::.
  835.  
  836. `mark-active'
  837.      *note The Mark::.
  838.  
  839. `mark-ring'
  840.      *note The Mark::.
  841.  
  842. `minor-modes'
  843.      *note Minor Modes::.
  844.  
  845. `modeline-format'
  846.      *note Modeline Data::.
  847.  
  848. `modeline-buffer-identification'
  849.      *note Modeline Variables::.
  850.  
  851. `modeline-format'
  852.      *note Modeline Data::.
  853.  
  854. `modeline-modified'
  855.      *note Modeline Variables::.
  856.  
  857. `modeline-process'
  858.      *note Modeline Variables::.
  859.  
  860. `mode-name'
  861.      *note Modeline Variables::.
  862.  
  863. `overwrite-mode'
  864.      *note Insertion::.
  865.  
  866. `paragraph-separate'
  867.      *note Standard Regexps::.
  868.  
  869. `paragraph-start'
  870.      *note Standard Regexps::.
  871.  
  872. `point-before-scroll'
  873.      Used for communication between mouse commands and scroll-bar
  874.      commands.
  875.  
  876. `require-final-newline'
  877.      *note Insertion::.
  878.  
  879. `selective-display'
  880.      *note Selective Display::.
  881.  
  882. `selective-display-ellipses'
  883.      *note Selective Display::.
  884.  
  885. `tab-width'
  886.      *note Usual Display::.
  887.  
  888. `truncate-lines'
  889.      *note Truncation::.
  890.  
  891. `vc-mode'
  892.      *note Modeline Variables::.
  893.  
  894. 
  895. File: lispref.info,  Node: Standard Keymaps,  Next: Standard Hooks,  Prev: Standard Buffer-Local Variables,  Up: Top
  896.  
  897. Standard Keymaps
  898. ****************
  899.  
  900.    The following symbols are used as the names for various keymaps.
  901. Some of these exist when XEmacs is first started, others are loaded
  902. only when their respective mode is used.  This is not an exhaustive
  903. list.
  904.  
  905.    Almost all of these maps are used as local maps.  Indeed, of the
  906. modes that presently exist, only Vip mode and Terminal mode ever change
  907. the global keymap.
  908.  
  909. `bookmark-map'
  910.      A keymap containing bindings to bookmark functions.
  911.  
  912. `Buffer-menu-mode-map'
  913.      A keymap used by Buffer Menu mode.
  914.  
  915. `c++-mode-map'
  916.      A keymap used by C++ mode.
  917.  
  918. `c-mode-map'
  919.      A keymap used by C mode.  A sparse keymap used by C mode.
  920.  
  921. `command-history-map'
  922.      A keymap used by Command History mode.
  923.  
  924. `ctl-x-4-map'
  925.      A keymap for subcommands of the prefix `C-x 4'.
  926.  
  927. `ctl-x-5-map'
  928.      A keymap for subcommands of the prefix `C-x 5'.
  929.  
  930. `ctl-x-map'
  931.      A keymap for `C-x' commands.
  932.  
  933. `debugger-mode-map'
  934.      A keymap used by Debugger mode.
  935.  
  936. `dired-mode-map'
  937.      A keymap for `dired-mode' buffers.
  938.  
  939. `edit-abbrevs-map'
  940.      A keymap used in `edit-abbrevs'.
  941.  
  942. `edit-tab-stops-map'
  943.      A keymap used in `edit-tab-stops'.
  944.  
  945. `electric-buffer-menu-mode-map'
  946.      A keymap used by Electric Buffer Menu mode.
  947.  
  948. `electric-history-map'
  949.      A keymap used by Electric Command History mode.
  950.  
  951. `emacs-lisp-mode-map'
  952.      A keymap used by Emacs Lisp mode.
  953.  
  954. `help-map'
  955.      A keymap for characters following the Help key.
  956.  
  957. `Helper-help-map'
  958.      A keymap used by the help utility package.
  959.      It has the same keymap in its value cell and in its function cell.
  960.  
  961. `Info-edit-map'
  962.      A keymap used by the `e' command of Info.
  963.  
  964. `Info-mode-map'
  965.      A keymap containing Info commands.
  966.  
  967. `isearch-mode-map'
  968.      A keymap that defines the characters you can type within
  969.      incremental search.
  970.  
  971. `itimer-edit-map'
  972.      A keymap used when in Itimer Edit mode.
  973.  
  974. `lisp-interaction-mode-map'
  975.      A keymap used by Lisp mode.
  976.  
  977. `lisp-mode-map'
  978.      A keymap used by Lisp mode.
  979.  
  980.      A keymap for minibuffer input with completion.
  981.  
  982. `minibuffer-local-isearch-map'
  983.      A keymap for editing isearch strings in the minibuffer.
  984.  
  985. `minibuffer-local-map'
  986.      Default keymap to use when reading from the minibuffer.
  987.  
  988. `minibuffer-local-must-match-map'
  989.      A keymap for minibuffer input with completion, for exact match.
  990.  
  991. `mode-specific-map'
  992.      The keymap for characters following `C-c'.  Note, this is in the
  993.      global map.  This map is not actually mode specific: its name was
  994.      chosen to be informative for the user in `C-h b'
  995.      (`display-bindings'), where it describes the main use of the `C-c'
  996.      prefix key.
  997.  
  998. `modeline-map'
  999.      The keymap consulted for mouse-clicks on the modeline of a window.
  1000.  
  1001. `objc-mode-map'
  1002.      A keymap used in Objective C mode as a local map.
  1003.  
  1004. `occur-mode-map'
  1005.      A local keymap used by Occur mode.
  1006.  
  1007. `overriding-local-map'
  1008.      A keymap that overrides all other local keymaps.
  1009.  
  1010. `query-replace-map'
  1011.      A local keymap used for responses in `query-replace' and related
  1012.      commands; also for `y-or-n-p' and `map-y-or-n-p'.  The functions
  1013.      that use this map do not support prefix keys; they look up one
  1014.      event at a time.
  1015.  
  1016. `read-expression-map'
  1017.      The minibuffer keymap used for reading Lisp expressions.
  1018.  
  1019. `read-shell-command-map'
  1020.      The minibuffer keymap used by shell-command and related commands.
  1021.  
  1022. `shared-lisp-mode-map'
  1023.      A keymap for commands shared by all sorts of Lisp modes.
  1024.  
  1025. `text-mode-map'
  1026.      A keymap used by Text mode.
  1027.  
  1028. `toolbar-map'
  1029.      The keymap consulted for mouse-clicks over a toolbar.
  1030.  
  1031. `view-mode-map'
  1032.      A keymap used by View mode.
  1033.  
  1034. 
  1035. File: lispref.info,  Node: Standard Hooks,  Next: Index,  Prev: Standard Keymaps,  Up: Top
  1036.  
  1037. Standard Hooks
  1038. **************
  1039.  
  1040.    The following is a list of hook variables that let you provide
  1041. functions to be called from within Emacs on suitable occasions.
  1042.  
  1043.    Most of these variables have names ending with `-hook'.  They are
  1044. "normal hooks", run by means of `run-hooks'.  The value of such a hook
  1045. is a list of functions.  The recommended way to put a new function on
  1046. such a hook is to call `add-hook'.  *Note Hooks::, for more information
  1047. about using hooks.
  1048.  
  1049.    The variables whose names end in `-function' have single functions
  1050. as their values.  Usually there is a specific reason why the variable is
  1051. not a normal hook, such as the need to pass arguments to the function.
  1052. (In older Emacs versions, some of these variables had names ending in
  1053. `-hook' even though they were not normal hooks.)
  1054.  
  1055.    The variables whose names end in `-hooks' or `-functions' have lists
  1056. of functions as their values, but these functions are called in a
  1057. special way (they are passed arguments, or else their values are used).
  1058.  
  1059. `activate-menubar-hook'
  1060. `ad-definition-hooks'
  1061. `add-log-current-defun-function'
  1062. `after-change-function'
  1063. `after-change-functions'
  1064. `after-delete-annotation-hook'
  1065. `after-init-hook'
  1066. `after-insert-file-functions'
  1067. `after-save-hook'
  1068. `after-set-visited-file-name-hooks'
  1069. `after-write-file-hooks'
  1070. `auto-fill-function'
  1071. `auto-save-hook'
  1072. `before-change-function'
  1073. `before-change-functions'
  1074. `before-delete-annotation-hook'
  1075. `before-init-hook'
  1076. `before-make-frame-hook'
  1077. `blink-paren-function'
  1078. `buffers-menu-switch-to-buffer-function'
  1079. `c++-mode-hook'
  1080. `c-mode-hook'
  1081. `calendar-load-hook'
  1082. `command-history-hook'
  1083. `comment-indent-function'
  1084. `compilation-buffer-name-function'
  1085. `compilation-finish-function'
  1086. `compilation-mode-hook'
  1087. `create-frame-hook'
  1088. `delete-frame-hook'
  1089. `deselect-frame-hook'
  1090. `diary-display-hook'
  1091. `diary-hook'
  1092. `dired-after-readin-hook'
  1093. `dired-before-readin-hook'
  1094. `dired-load-hook'
  1095. `dired-mode-hook'
  1096. `disabled-command-hook'
  1097. `display-buffer-function'
  1098. `edit-picture-hook'
  1099. `electric-buffer-menu-mode-hook'
  1100. `electric-command-history-hook'
  1101. `electric-help-mode-hook'
  1102. `emacs-lisp-mode-hook'
  1103. `find-file-hooks'
  1104. `find-file-not-found-hooks'
  1105. `first-change-hook'
  1106. `font-lock-mode-hook'
  1107. `indent-line-function'
  1108. `indent-mim-hook'
  1109. `indent-region-function'
  1110. `initial-calendar-window-hook'
  1111. `isearch-mode-end-hook'
  1112. `isearch-mode-hook'
  1113. `kill-buffer-hook'
  1114. `kill-buffer-query-functions'
  1115. `kill-emacs-hook'
  1116. `kill-emacs-query-functions'
  1117. `kill-hooks'
  1118. `LaTeX-mode-hook'
  1119. `ledit-mode-hook'
  1120. `LaTeX-mode-hook'
  1121. `ledit-mode-hook'
  1122. `lisp-indent-function'
  1123. `lisp-interaction-mode-hook'
  1124. `lisp-mode-hook'
  1125. `list-diary-entries-hook'
  1126. `m2-mode-hook'
  1127. `mail-mode-hook'
  1128. `mail-setup-hook'
  1129. `make-annotation-hook'
  1130. `map-frame-hook'
  1131. `mark-diary-entries-hook'
  1132. `medit-mode-hook'
  1133. `menu-no-selection-hook'
  1134. `mh-compose-letter-hook'
  1135. `mh-folder-mode-hook'
  1136. `mh-letter-mode-hook'
  1137. `mim-mode-hook'
  1138. `minibuffer-exit-hook'
  1139. `minibuffer-setup-hook'
  1140. `mode-motion-hook'
  1141. `mouse-enter-frame-hook'
  1142. `mouse-leave-frame-hook'
  1143. `news-mode-hook'
  1144. `news-reply-mode-hook'
  1145. `news-setup-hook'
  1146. `nongregorian-diary-listing-hook'
  1147. `nongregorian-diary-marking-hook'
  1148. `nroff-mode-hook'
  1149. `outline-mode-hook'
  1150. `plain-TeX-mode-hook'
  1151. `post-command-hook'
  1152. `post-gc-hook'
  1153. `pre-abbrev-expand-hook'
  1154. `pre-command-hook'
  1155. `pre-display-buffer-function'
  1156. `pre-gc-hook'
  1157. `print-diary-entries-hook'
  1158. `prolog-mode-hook'
  1159. `protect-innocence-hook'
  1160. `revert-buffer-function'
  1161. `revert-buffer-insert-contents-function'
  1162. `rmail-edit-mode-hook'
  1163. `rmail-mode-hook'
  1164. `rmail-summary-mode-hook'
  1165. `scheme-indent-hook'
  1166. `scheme-mode-hook'
  1167. `scribe-mode-hook'
  1168. `select-frame-hook'
  1169. `send-mail-function'
  1170. `shell-mode-hook'
  1171. `shell-set-directory-error-hook'
  1172. `suspend-hook'
  1173. `suspend-resume-hook'
  1174. `temp-buffer-show-function'
  1175. `term-setup-hook'
  1176. `terminal-mode-hook'
  1177. `terminal-mode-break-hook'
  1178. `TeX-mode-hook'
  1179. `text-mode-hook'
  1180. `today-visible-calendar-hook'
  1181. `today-invisible-calendar-hook'
  1182. `tooltalk-message-handler-hook'
  1183. `tooltalk-pattern-handler-hook'
  1184. `tooltalk-unprocessed-message-hook'
  1185. `unmap-frame-hook'
  1186. `vc-checkin-hook'
  1187. `vi-mode-hook'
  1188. `view-hook'
  1189. `window-setup-hook'
  1190. `write-contents-hooks'
  1191. `write-file-hooks'
  1192. `write-region-annotate-functions'
  1193. `x-lost-selection-hooks'
  1194. `x-sent-selection-hooks'
  1195. `zmacs-activate-region-hook'
  1196. `zmacs-deactivate-region-hook'
  1197. `zmacs-update-region-hook'
  1198.